<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>签到</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="sign.css"/>
<script type="text/javascript" src="calendar.js"></script>
<link rel="stylesheet" href="bootstrap.min.css"/>
<script type="text/javascript">
document.getElementsByTagName("html")[0].style.fontSize=document.documentElement.clientWidth/20+"px";
$(function(){
	$("#j_two").click(function(){
		
		window.location.href="chongzhi.html";
		
	});
	$("#j_three").click(function(){
		window.location.href="yaoqing.html";
	});
//签到：历史记录	

  
window.onload=function(){
	var message = {"state":"1","date":[]};
	var signList=[];
	$.post("http://app2.erenepu.com/index.php/api/signListInfo",
	{"token": GetQueryString("token")},
		function(data){
			var data2 = data.data;
			//alert(data2)
			var data1=data2.replace(/:/g,"");
			var data3 = data2.split(":");
				data3.shift();
			var data4 = data3;
			var tDate=new Date();
			var tday=tDate.getDate();
			message.date.push(data4);
			var oDate=new Date();
		
			if( data4[data4.length-1] == tday){	
				$('#btn').addClass("disabled");
				$('#btn').unbind();
				}
		for(var i=0; i<data4.length; i++){
			signList.push({"signDay":data4[i]});
		}	
			
			calUtil.init(signList);
		},
		"json"
		
	)};

	function GetQueryString(name)
{
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}

	

		
		$('#btn').on('click',function(){
			$.post("http://app2.erenepu.com/index.php/api/sign_1",
			{"token": GetQueryString("token")} ,
			function(data){
				if (data.status == 1) {
						alert(data.msg);
							$('#btn').addClass("disabled");
							$('#btn').unbind();
						
						
                    }else {
                  
                     	   alert(data.msg);
						  
						
					
                    }
			}
		)
	});
	
});

</script>
</head>
<body>
<div class="block">
    <div class="headr clearfix">
        <div class="fl everyday">每日签到</div>
        <div class="btn btn-danger btn-sm fr" id="btn" style=" font-weight:bold;">签到</div>
    </div>
    <div style="width:100%;" id="calendar"></div>
    <div class="z-btn clearfix">
    	<div class="fl btn btn-danger" id="j_two" style=" font-weight:bold;">充值</div>
        <div class="fr btn btn-danger" id="j_three" style=" font-weight:bold;">邀请</div>
    </div>
</div>
<div class="foot">
    <div class="btn btn-warning"  style=" font-weight:500;">温馨提示</div>
    <p>* 因系统升级，凡总投资高于1000元者每日签到、每日邀请活动正常使用，但每日任务（每日签到、每日充值、每日邀请）5元奖励活动暂停使用，升级之后再行恢复，如有不便敬请谅解</p>
</div>
</body>
</html>